[IA64] purge stale tlb entry in ia64_do_page_fault()
authorawilliam@lappy <awilliam@lappy>
Tue, 20 Jun 2006 22:21:13 +0000 (16:21 -0600)
committerawilliam@lappy <awilliam@lappy>
Tue, 20 Jun 2006 22:21:13 +0000 (16:21 -0600)
fix ia64_do_page_fault(). When it determines to again, it might remains stale
entry in tlb entry hoping next tlb imsert may purge it.
But if reflects faults, the stale entry remains. it must be purged.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/xen/faults.c

index dfda9af4d7269130da6f2335e9744f977c867bef..eb4e6091c8ebf797f12d26fe858f894adfd0c37d 100644 (file)
@@ -215,6 +215,8 @@ void ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_reg
        unsigned long pteval;
        unsigned long is_data = !((isr >> IA64_ISR_X_BIT) & 1UL);
        IA64FAULT fault;
+       int is_ptc_l_needed = 0;
+       u64 logps;
 
        if ((isr & IA64_ISR_IR) && handle_lazy_cover(current, regs)) return;
        if ((isr & IA64_ISR_SP)
@@ -232,7 +234,6 @@ void ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_reg
  again:
        fault = vcpu_translate(current,address,is_data,&pteval,&itir,&iha);
        if (fault == IA64_NO_FAULT || fault == IA64_USE_TLB) {
-               u64 logps;
                struct p2m_entry entry;
                pteval = translate_domain_pte(pteval, address, itir, &logps, &entry);
                vcpu_itc_no_srlz(current,is_data?2:1,address,pteval,-1UL,logps);
@@ -242,11 +243,18 @@ void ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_reg
                           matching.  Undo the work.  */
                        vcpu_flush_tlb_vhpt_range(address & ((1 << logps) - 1),
                                                  logps);
+
+                       // the stale entry which we inserted above
+                       // may remains in tlb cache.
+                       // we don't purge it now hoping next itc purges it.
+                       is_ptc_l_needed = 1;
                        goto again;
                }
                return;
        }
 
+       if (is_ptc_l_needed)
+               vcpu_ptc_l(current, address, logps);
        if (!user_mode (regs)) {
                /* The fault occurs inside Xen.  */
                if (!ia64_done_with_exception(regs)) {